Skip to content

tesseract: make tessdata a fixed output derivation#41227

Merged
xeji merged 1 commit intoNixOS:masterfrom
symphorien:tesseract
Jun 18, 2018
Merged

tesseract: make tessdata a fixed output derivation#41227
xeji merged 1 commit intoNixOS:masterfrom
symphorien:tesseract

Conversation

@symphorien
Copy link
Member

This make tessdata a fixed output derivation if all languages are enabled or (only some languages are enabled and a hash is provided).

Motivation for this change

the full tessdata is nearly a GB, so sparing a copy each time we need to
rebuild tesseract without updating tessdata is worth it.
For example, I have currently 10 copies of tessdata in my store for past generations of my system. Well, they are optimised, but still.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/) tesseract --list-langs
  • Fits CONTRIBUTING.md.

the full tessdata is nearly a GB, so sparing a copy each time we need to
rebuild tesseract without updating tessdata is worth it.
@symphorien
Copy link
Member Author

cc @viric as maintainer.

@symphorien symphorien changed the title tesseract: make tessdata a fix output derivation tesseract: make tessdata a fixed output derivation May 29, 2018
@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels May 29, 2018
@xeji
Copy link
Contributor

xeji commented Jun 18, 2018

@GrahamcOfBorg build tesseract

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tesseract

Partial log (click to expand)

glibPreFixupPhase
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/fzn881zha4lyd2myk6acl3fm3nb4pjyx-tesseract-3.05.00
shrinking /nix/store/fzn881zha4lyd2myk6acl3fm3nb4pjyx-tesseract-3.05.00/lib/libtesseract.so.3.0.5
shrinking /nix/store/fzn881zha4lyd2myk6acl3fm3nb4pjyx-tesseract-3.05.00/bin/tesseract
gzipping man pages under /nix/store/fzn881zha4lyd2myk6acl3fm3nb4pjyx-tesseract-3.05.00/share/man/
strip is /nix/store/4mf2xm9p32lzrim927yk92xhx35yaz62-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/fzn881zha4lyd2myk6acl3fm3nb4pjyx-tesseract-3.05.00/lib  /nix/store/fzn881zha4lyd2myk6acl3fm3nb4pjyx-tesseract-3.05.00/bin
patching script interpreter paths in /nix/store/fzn881zha4lyd2myk6acl3fm3nb4pjyx-tesseract-3.05.00
checking for references to /build in /nix/store/fzn881zha4lyd2myk6acl3fm3nb4pjyx-tesseract-3.05.00...

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: tesseract

Partial log (click to expand)

 /nix/store/phl4rr4zq1ydz4v3h4r1pkwnk81gq3ss-coreutils-8.29/bin/install -c -m 644 unicharambigs.5 unicharset.5 '/nix/store/srkj7qqvj89lflv9pfbl6bl75zrzyjix-tesseract-3.05.00/share/man/man5'
make[2]: Leaving directory '/private/tmp/nix-build-tesseract-3.05.00.drv-0/source/doc'
make[1]: Leaving directory '/private/tmp/nix-build-tesseract-3.05.00.drv-0/source/doc'
glibPreFixupPhase
post-installation fixup
gzipping man pages under /nix/store/srkj7qqvj89lflv9pfbl6bl75zrzyjix-tesseract-3.05.00/share/man/
strip is /nix/store/8q05v40n0f7amgw70pk6bkb23r7hrzgn-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/srkj7qqvj89lflv9pfbl6bl75zrzyjix-tesseract-3.05.00/lib  /nix/store/srkj7qqvj89lflv9pfbl6bl75zrzyjix-tesseract-3.05.00/bin
patching script interpreter paths in /nix/store/srkj7qqvj89lflv9pfbl6bl75zrzyjix-tesseract-3.05.00
/nix/store/srkj7qqvj89lflv9pfbl6bl75zrzyjix-tesseract-3.05.00

@xeji
Copy link
Contributor

xeji commented Jun 18, 2018

@GrahamcOfBorg build python36Packages.pyocr

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: python36Packages.pyocr

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: python36Packages.pyocr

Partial log (click to expand)

test_basic (tests.tests_cuneiform.TestWordBox) ... ok
test_european (tests.tests_cuneiform.TestWordBox) ... ok
test_french (tests.tests_cuneiform.TestWordBox) ... ok
test_write_read (tests.tests_cuneiform.TestWordBox) ... ok

----------------------------------------------------------------------
Ran 65 tests in 20.288s

OK
/nix/store/f1kszp52ni6lvwfgx4pgnxmi6i4akg9k-python3.6-pyocr-0.4.7

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tesseract

Partial log (click to expand)

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/qfxjh79qsdd4b68f8vsa4mg4j1bk2g2g-tesseract-3.05.00
shrinking /nix/store/qfxjh79qsdd4b68f8vsa4mg4j1bk2g2g-tesseract-3.05.00/bin/tesseract
shrinking /nix/store/qfxjh79qsdd4b68f8vsa4mg4j1bk2g2g-tesseract-3.05.00/lib/libtesseract.so.3.0.5
gzipping man pages under /nix/store/qfxjh79qsdd4b68f8vsa4mg4j1bk2g2g-tesseract-3.05.00/share/man/
strip is /nix/store/min150lkigznaayzpwvf8d4jdl1dqvx6-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/qfxjh79qsdd4b68f8vsa4mg4j1bk2g2g-tesseract-3.05.00/lib  /nix/store/qfxjh79qsdd4b68f8vsa4mg4j1bk2g2g-tesseract-3.05.00/bin
patching script interpreter paths in /nix/store/qfxjh79qsdd4b68f8vsa4mg4j1bk2g2g-tesseract-3.05.00
checking for references to /build in /nix/store/qfxjh79qsdd4b68f8vsa4mg4j1bk2g2g-tesseract-3.05.00...
/nix/store/qfxjh79qsdd4b68f8vsa4mg4j1bk2g2g-tesseract-3.05.00

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: python36Packages.pyocr

Partial log (click to expand)

AssertionError: False is not true : English training does not appear to be installed. (required for the tests)

----------------------------------------------------------------------
Ran 65 tests in 124.530s

FAILED (failures=1, errors=1)
Test failed: <unittest.runner.TextTestResult run=65 errors=1 failures=1>
error: Test failed: <unittest.runner.TextTestResult run=65 errors=1 failures=1>
builder for '/nix/store/yg7irp6alqm47v197vwcd4sj18kh0j99-python3.6-pyocr-0.4.7.drv' failed with exit code 1
error: build of '/nix/store/yg7irp6alqm47v197vwcd4sj18kh0j99-python3.6-pyocr-0.4.7.drv' failed

@xeji
Copy link
Contributor

xeji commented Jun 18, 2018

pyocr failure on aarch64 is unrelated, same error without this PR.

@xeji xeji merged commit b30d529 into NixOS:master Jun 18, 2018
@symphorien symphorien deleted the tesseract branch March 21, 2020 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants